import { useTemplateRef } from "vue";
import PageContent from "@/components/page-content/page-content.vue";

function usePageContent() {
  const contentRef = useTemplateRef<InstanceType<typeof PageContent>>("contentRef");

  const handleQueryClick = (queryInfo: any) => {
    contentRef.value?.fetchPageListData(queryInfo);
  };
  const handleResetClick = () => {
    contentRef.value?.fetchPageListData();
  };

  return {
    contentRef,
    handleQueryClick,
    handleResetClick
  };
}

export default usePageContent;
